#include <algorithm>
#include <cstdio>

const int N = 505, M = 5e5 + 5;
int n, m, tot, st[M], ed[M], deg[N];
int e_cnt, heads[N];
double a[N][N], x[N], f[M];

struct Edge {
  int v, nxt;
} e[M << 1];

inline void add(int u, int v) {
  e[++e_cnt].v = v, e[e_cnt].nxt = heads[u], heads[u] = e_cnt;
}

void Gauss(int n) {
  for (int i = 1; i <= n; ++i) {
    int pos = i;
    for (int j = i + 1; j <= n; ++j)
      if (std::abs(a[i][j]) > std::abs(a[pos][j])) pos = i;
    for (int k = 1; k <= n + 1; ++k) std::swap(a[i][k], a[pos][k]);
    for (int j = 1; j <= n; ++j) {
      if (i == j) continue;
      double rate = a[j][i] / a[i][i];
      for (int k = 1; k <= n + 1; ++k) a[j][k] -= a[i][k] * rate;
    }
  }
  for (int i = 1; i <= n; ++i) x[i] = a[i][n + 1] / a[i][i];
}

int main() {
#ifndef ONLINE_JUDGE
#ifdef LOCAL
  freopen("testdata.in", "r", stdin);
  freopen("testdata.out", "w", stdout);
#endif
#ifndef LOCAL
  freopen("P3232 [HNOI2013]游走.in", "r", stdin);
  freopen("P3232 [HNOI2013]游走.out", "w", stdout);
#endif
#endif

  scanf("%d%d", &n, &m);
  for (int i = 1; i <= m; ++i) {
    scanf("%d%d", &st[i], &ed[i]);
    add(st[i], ed[i]), add(ed[i], st[i]);
    ++deg[st[i]], ++deg[ed[i]];
  }
  for (int u = 1; u < n; ++u) {
    a[u][u] = 1.0;
    for (int i = heads[u], v; i; i = e[i].nxt)
      if ((v = e[i].v) != n) a[u][v] = -1.0 / deg[v];
  }
  a[1][n] = 1;
  Gauss(n - 1);
  for (int i = 1; i <= m; ++i) {
    int a = st[i], b = ed[i];
    if (a != n) f[i] += x[a] / deg[a];
    if (b != n) f[i] += x[b] / deg[b];
  }
  std::sort(f + 1, f + m + 1);
  double ans = 0;
  for (int i = 1; i <= m; ++i) ans += (m - i + 1) * f[i];
  printf("%.3lf\n", ans);
  return 0;
}